44 #include "simpletools.h" 50 #if defined(__cplusplus) 253 void accels(
int *x,
int *y,
int *z);
281 int store(
char *contact);
306 void retrieve(
char *contact,
int recIdx);
325 int eeprint(
const char *fmt, ...);
360 int eescan(
int recIdx,
const char *fmt, ...);
516 char*
ee_readStr(
unsigned char *s,
int n,
int addr);
597 int irprint(
const char *fmt, ...);
617 int irscan(
const char *fmt, ...);
629 void ir_send(
char *s,
int ssize);
692 void cursor(
int col,
int row);
729 void point(
int x,
int y,
int color);
748 void line(
int x0,
int y0,
int x1,
int y1,
int c);
767 void box(
int x0,
int y0,
int x1,
int y1,
int c);
786 void boxFilled(
int x0,
int y0,
int x1,
int y1,
int c);
809 void triangle(
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
int c);
832 void triangleFilled(
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
int c);
849 void circle(
int x0,
int y0,
int r,
int c);
885 void shape(
char *img,
int bw,
int xtl,
int ytl,
int xpics,
int ypics);
1009 #ifndef DOXYGEN_SHOULD_SKIP_THIS 1021 int32_t ircom_start(int32_t rxd, int32_t txd, int32_t baud, int32_t freq);
1022 void ircom_stop(
void);
1023 int32_t ircom_rx(
void);
1024 int32_t ircom_rxcheck(
void);
1025 int32_t ircom_rxtime(int32_t mslim);
1026 int32_t ircom_rxflush(
void);
1027 int32_t ircom_tx(int32_t c);
1028 int32_t ircom_str(
char *p_zstr);
1029 int32_t ircom_dec(int32_t value);
1030 int32_t ircom_rjdec(int32_t val, int32_t width, int32_t pchar);
1031 int32_t ircom_hex(int32_t value, int32_t digits);
1032 int32_t ircom_tx_bin(int32_t value, int32_t digits);
1033 int32_t ircom_txflush(
void);
1041 #define RGB_PIN (10) 1064 #define NAV_COM_L (14) 1068 #define NAV_COM_R (15) 1072 #define NAV_TOUCH_L (4) 1076 #define NAV_TOUCH_R (2) 1082 #define IR_BAUD (2400) 1087 #define IR_FREQ (36000) 1101 #define OLED_DAT (21) 1105 #define OLED_CLK (20) 1109 #define OLED_DC (22) 1113 #define OLED_RST (19) 1117 #define OLED_CS (18) 1122 #define TV_DAC2 (26) 1126 #define TV_DAC1 (25) 1130 #define TV_DAC0 (24) 1142 #define STX 2 //serial framing bytes 1149 #ifndef LCD_BUFFER_SIZE_BOTH_TYPES 1150 #define LCD_BUFFER_SIZE_BOTH_TYPES (1024) 1153 #ifndef SSD1306_SWITCHCAPVCC 1154 #define SSD1306_SWITCHCAPVCC (2) 1158 #define TYPE_128X32 (32) 1162 #define TYPE_128X64 (64) 1165 #ifndef EE_BADGE_DATA_START 1166 #define EE_BADGE_DATA_START 32768 1169 #ifndef EE_BADGE_DATA_END 1170 #define EE_BADGE_DATA_END 65536 - 4 1173 void init_MMA7660FC(
void);
1228 #define MMA7660_I2C 0b1001100 1232 #define ALERT_BIT 0b01000000 //0x40 1236 #define ALERT_XYZT 0x40404040 1240 #define BUF_SIZE (128) 1244 #define BUF_MASK ((BUF_SIZE - 1)) 1247 typedef struct jm_ir_hdserial {
1249 volatile int32_t cog;
1251 volatile int32_t rxhead;
1253 volatile int32_t rxtail;
1255 volatile int32_t rxhub;
1257 volatile int32_t txhead;
1259 volatile int32_t txtail;
1261 volatile int32_t txhub;
1263 volatile int32_t rxpin;
1265 volatile int32_t txpin;
1267 volatile int32_t bitticks;
1269 volatile int32_t frsetup;
1271 volatile uint8_t rxbuf[BUF_SIZE];
1272 volatile uint8_t txbuf[BUF_SIZE];
1279 #ifndef SSD1306_LCDWIDTH 1280 #define SSD1306_LCDWIDTH (128) 1283 #ifndef SSD1306_LCDHEIGHT32 1284 #define SSD1306_LCDHEIGHT32 (32) 1287 #ifndef SSD1306_LCDHEIGHT64 1288 #define SSD1306_LCDHEIGHT64 (64) 1291 #ifndef SSD1306_LCDCHARMAX 1292 #define SSD1306_LCDCHARMAX (8) 1295 #ifndef SSD1306_SETCONTRAST 1296 #define SSD1306_SETCONTRAST (129) 1299 #ifndef SSD1306_DISPLAYALLON_RESUME 1300 #define SSD1306_DISPLAYALLON_RESUME (164) 1303 #ifndef SSD1306_DISPLAYALLON 1304 #define SSD1306_DISPLAYALLON (165) 1307 #ifndef SSD1306_NORMALDISPLAY 1308 #define SSD1306_NORMALDISPLAY (166) 1311 #ifndef SSD1306_INVERTDISPLAY 1312 #define SSD1306_INVERTDISPLAY (167) 1315 #ifndef SSD1306_DISPLAYOFF 1316 #define SSD1306_DISPLAYOFF (174) 1319 #ifndef SSD1306_DISPLAYON 1320 #define SSD1306_DISPLAYON (175) 1323 #ifndef SSD1306_SETDISPLAYOFFSET 1324 #define SSD1306_SETDISPLAYOFFSET (211) 1327 #ifndef SSD1306_SETCOMPINS 1328 #define SSD1306_SETCOMPINS (218) 1331 #ifndef SSD1306_SETVCOMDETECT 1332 #define SSD1306_SETVCOMDETECT (219) 1335 #ifndef SSD1306_SETDISPLAYCLOCKDIV 1336 #define SSD1306_SETDISPLAYCLOCKDIV (213) 1339 #ifndef SSD1306_SETPRECHARGE 1340 #define SSD1306_SETPRECHARGE (217) 1343 #ifndef SSD1306_SETMULTIPLEX 1344 #define SSD1306_SETMULTIPLEX (168) 1347 #ifndef SSD1306_SETLOWCOLUMN 1348 #define SSD1306_SETLOWCOLUMN (0) 1351 #ifndef SSD1306_SETHIGHCOLUMN 1352 #define SSD1306_SETHIGHCOLUMN (16) 1355 #ifndef SSD1306_SETSTARTLINE 1356 #define SSD1306_SETSTARTLINE (64) 1359 #ifndef SSD1306_MEMORYMODE 1360 #define SSD1306_MEMORYMODE (32) 1363 #ifndef SSD1306_COMSCANINC 1364 #define SSD1306_COMSCANINC (192) 1367 #ifndef SSD1306_COMSCANDEC 1368 #define SSD1306_COMSCANDEC (200) 1371 #ifndef SSD1306_SEGREMAP 1372 #define SSD1306_SEGREMAP (160) 1375 #ifndef SSD1306_CHARGEPUMP 1376 #define SSD1306_CHARGEPUMP (141) 1379 #ifndef SSD1306_EXTERNALVCC 1380 #define SSD1306_EXTERNALVCC (1) 1385 #ifndef SSD1306_ACTIVATE_SCROLL 1386 #define SSD1306_ACTIVATE_SCROLL (47) 1389 #ifndef SSD1306_DEACTIVATE_SCROLL 1390 #define SSD1306_DEACTIVATE_SCROLL (46) 1393 #ifndef SSD1306_SET_VERT_SCROLL_AREA 1394 #define SSD1306_SET_VERT_SCROLL_AREA (163) 1397 #ifndef SSD1306_RIGHT_HORIZ_SCROLL 1398 #define SSD1306_RIGHT_HORIZ_SCROLL (38) 1401 #ifndef SSD1306_LEFT_HORIZ_SCROLL 1402 #define SSD1306_LEFT_HORIZ_SCROLL (39) 1405 #ifndef SSD1306_VERTRIGHTHORIZSCROLL 1406 #define SSD1306_VERTRIGHTHORIZSCROLL (41) 1409 #ifndef SSD1306_VERTLEFTHORIZSCROLL 1410 #define SSD1306_VERTLEFTHORIZSCROLL (42) 1413 #ifndef LCD_BUFFER_SIZE_BOTH_TYPES 1414 #define LCD_BUFFER_SIZE_BOTH_TYPES (1024) 1417 #ifndef SSD1306_SWITCHCAPVCC 1418 #define SSD1306_SWITCHCAPVCC (2) 1422 #define TYPE_128X32 (32) 1426 #define TYPE_128X64 (64) 1430 typedef volatile struct screen {
1432 volatile int command;
1438 volatile int vccstate;
1439 volatile int displayWidth;
1440 volatile int displayHeight;
1441 volatile int displayType;
1442 volatile int AutoUpdate;
1443 volatile uint8_t buffer[LCD_BUFFER_SIZE_BOTH_TYPES];
1444 volatile int charSize;
1450 extern uint8_t oleddat[];
1452 void screen_string8x2(
char *str, int32_t len, int32_t row, int32_t col);
1453 void screen_string16x4(
char *str,
int len,
int row,
int col);
1454 void screen_char32x16(
int ch,
int row,
int col);
1455 void screen_char7x5(
int ch,
int row,
int col);
1457 int screen_HIGH(
int Pin);
1458 int screen_LOW(
int Pin);
1459 int32_t screen_swap( int32_t a, int32_t b);
1460 int screen_AutoUpdateOn(
void );
1461 int screen_AutoUpdateOff(
void );
1463 void ee_displayIndex(
int start,
int end,
int increment);
1464 void stringView(
char *s,
int ssize);
1465 int sscan_ct(
const char *str,
const char *fmt, ...);
1466 int _doscanf_ct(
const char* str,
const char *fmt, va_list args);
1468 void ir_start(
void);
1470 void ee_badgeCheck(
void);
1471 int light_start(
void );
1472 int touch_start(
int count,
unsigned char *p_pins,
int dms);
1474 int screen_GetDisplayHeight(
void );
1475 int screen_GetDisplayWidth(
void );
1476 int screen_GetDisplayType(
void );
1477 int screen_ssd1306_Command(
int thecmd);
1478 int screen_ssd1306_Data(
int thedata);
1479 int screen_getSplash(
void );
1480 int screen_SHIFTOUT(
int Dpin,
int Cpin,
int CSpin,
int Bits,
int Value);
1481 int screen_WRITEBUFF(
int Dpin,
int Cpin,
int CSpin,
int Bits,
int Addr);
1482 int screen_init(
int ChipSelect,
int DataCommand,
int TheData,
int TheClock,
int Reset,
int VCC_state,
int Type);
1483 void screen_string8x2(
char *str, int32_t len, int32_t row, int32_t col);
1484 void screen_string16x4(
char *str,
int len,
int row,
int col);
1486 int screen_getBuffer(
void );
1487 int screen_start(
void );
1488 int screen_stop(
void );
1490 void screen_char32x16(
int ch,
int row,
int col);
1491 void screen_char7x5(
int ch,
int row,
int col);
1494 int get_bit(
int bitNum,
int val);
1495 void set_bit(
int bitNum,
int *val);
1496 void clear_bit(
int bitNum,
int *val);
1500 #define INLINE__ static inline 1501 #define Yield__() __asm__ volatile( "" ::: "memory" ) 1502 #define PostEffect__(X, Y) __extension__({ int32_t tmp__ = (X); (X) = (Y); tmp__; }) 1504 #define INLINE__ static 1505 static int32_t tmp__;
1506 #define PostEffect__(X, Y) (tmp__ = (X), (X) = (Y), tmp__) 1508 #define waitcnt(n) _waitcnt(n) 1509 #define coginit(id, code, par) _coginit((unsigned)(par)>>2, (unsigned)(code)>>2, id) 1510 #define cognew(code, par) coginit(0x8, (code), (par)) 1511 #define cogstop(i) _cogstop(i) 1514 INLINE__ int32_t Min__(int32_t a, int32_t b) {
return a < b ? a : b; }
1515 INLINE__ int32_t Max__(int32_t a, int32_t b) {
return a > b ? a : b; }
1516 INLINE__ int32_t Shr__(uint32_t a, uint32_t b) {
return (a>>b); }
1517 INLINE__ int32_t Rotl__(uint32_t a, uint32_t b) {
return (a<<b) | (a>>(32-b)); }
1518 INLINE__ int32_t Rotr__(uint32_t a, uint32_t b) {
return (a>>b) | (a<<(32-b)); }
1519 INLINE__ int32_t Lookup__(int32_t x, int32_t b, int32_t a[], int32_t n) { int32_t i = (x)-(b);
return ((
unsigned)i >= n) ? 0 : (a)[i]; }
1526 #endif // DOXYGEN_SHOULD_SKIP_THIS 1529 #if defined(__cplusplus)